Repository navigation
docs: load sphinx_click before sphinx_autodoc_typehints - #534
Merged
Merged
Conversation
With Sphinx 9.1, "from sphinx.ext.autodoc import mock" returns the mock module instead of the function once sphinx_autodoc_typehints has been imported, so sphinx_click failed with "'module' object is not callable" and the CLI page was empty. Loading sphinx_click first keeps the function (see sphinx-doc/sphinx#14333). AI-Level: 7 AI-Model: Claude Sonnet 5.5 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CUNZAXTg3vthj5KZYCgf3m
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #534 +/- ##
=======================================
Coverage 78.23% 78.23%
=======================================
Files 54 54
Lines 3469 3469
Branches 435 435
=======================================
Hits 2714 2714
Misses 633 633
Partials 122 122
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
docs/usage/cli.mdwas empty:sphinx-clickfailed withTypeError: 'module' object is not callablewhen importingdicogis.cli.main:click_object.With Sphinx 9.1,
from sphinx.ext.autodoc import mockreturns themockmodule instead of the function oncesphinx_autodoc_typehintshas been imported (sphinx-doc/sphinx#14333), andsphinx_clickcalls it. Loadingsphinx_clickfirst inextensionskeeps the function. The order is no longer alphabetical, hence the comment indocs/conf.py.Reproduced on a minimal Sphinx project with both extension orders: the error occurs with
sphinx_autodoc_typehintsfirst and not withsphinx_clickfirst. The full build has not been run locally, so the CI run of this PR is the confirmation.Related issue(s)
Follows #532.
Type of change
fix/…branch)feature/…branch)docs/…branch or*.md/docs/**changes)packaging/…branch orbuilder/**changes)tooling/…branch or.github/**changes)tests/**changes)Checklist
pre-commit run --all-filespasses locallypytestpasses locallyAI/LLM disclosure
Generated by Claude Code